/**
 * ZeusGIS 主渲染进程入口
 * 负责启动和管理整个应用
 */

const ZeusGISApp = require('./src/app');

// 应用初始化标志
let appInitialized = false;

// 等待DOM加载完成后启动应用
document.addEventListener('DOMContentLoaded', () => {
    if (!appInitialized) {
        // 创建应用实例
        window.ZeusGIS = new ZeusGISApp();
        appInitialized = true;
        
        // 开发模式下暴露调试接口
        if (process.env.NODE_ENV === 'development') {
            window.ZeusGISDebug = {
                app: window.ZeusGIS,
                getAppInfo: () => window.ZeusGIS.getAppInfo(),
                getTool: (toolId) => window.ZeusGIS.getTool(toolId),
                restart: () => window.ZeusGIS.restart()
            };
            
            console.log('ZeusGIS Debug interface available at window.ZeusGISDebug');
        }
    }
});